/* memory setting */

#include "bmem.h"

void* bf_realloc(void* oldptr, unsigned size){
	if(size == 0){
		if(oldptr){
			free(oldptr);
		}
		return NULL;
	}
	oldptr = oldptr ? realloc(oldptr, size) : malloc(size);
	if(!oldptr){
		bf_error("Error: Do not have enough memory.");
		return NULL;
	}
	return oldptr;
}
